import { useEffect,useRef } from "react"


export const useUpdated = (callback) => {

   const isFirst = useRef(true)

    useEffect(() => {
        if(!isFirst.current) {
            callback() && callback 
        }else{

            isFirst.current = false
        }

    })
}